package com.base.cn.platform.os.service.manage.count;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 页面PV、UV数据统计
 *
 * @author s.li
 * @create 2018-08-24-14:37
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface PageViewCountService extends BaseService {

    /**
     * 查询每个栏目访问量统计数据
     * @return 统计数据实体
     */
    @RequestMapping(contextPath + "/queryPageViewCountNum")
    List<Map<String,Integer>> queryPageViewCountNum();

    /**
     * PC平台总PV数、PC平台总UV数
     * @return Map<String,Integer>
     */
    @RequestMapping(contextPath + "/queryPageUVpvSumNum")
    Map<String,Integer> queryPageUVpvSumNum(@RequestBody Map<String, String> map);

    /**
     * 添加PV、UV统计数据
     * @param pageKey 页面关键字
     * @param fromSource 访问来源
     */
    @RequestMapping(contextPath + "/addPageCount")
    void addPageCount(@RequestParam("pageKey") String pageKey,
                      @RequestParam("fromSource") String fromSource);
}
